<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Add Menu Page</title>
    <style type="text/css">
	<!--
	body {
		margin-left: 0px;
		margin-top: 0px;
		margin-right: 0px;
		margin-bottom: 0px;
		background-color: #EEF2FB;
	}
	-->
	</style>
	<link href="css/skin.css" rel="stylesheet" type="text/css" />
		<script language="JavaScript">   
	    function doSearch(){
			if(document.getElementById("Authority").value=="")
			{	
				window.location.href="list.action?authority="+document.getElementById("Authority").value;
			}else{
				window.location.href="list.action?authority="+document.getElementById("Authority").value;
		 	}
		}
		
		function add(){
		    window.location.href="edit.action?authority=<%=request.getParameter("authority")%>" + "&authorityId=";
		}
	</script>
  </head>  
  <body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td>
			 <table width="100%" border="0" cellpadding="0" cellspacing="0">
			 	<tr>
			 		<td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
				    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
				      <tr>
				        <td height="31"><div id="title" class="titlebt">List Authority</div>&nbsp;<input id="Authority" type="text" name="Authority"
						value="<s:property value="authority"/>" size="10" />
					<input type="button" value="Query" onClick="doSearch();">&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:add();'> Add Authority </a></td>
				      </tr>
				    </table></td>
				    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
			 	</tr>
			 </table>
			</td>    
		</tr>
		<tr>
		<td >
  <table width="100%" height="116" border="0" cellpadding="0" cellspacing="0" >
  
  <tr>
  <td width="17" background="images/mail_leftbg.gif"><img src="images/mail_leftbg.gif" width="17" height="17" /></td>
  <td>
   <table cellspacing="0" align="center">
						<thead>
							<tr>
								<th>
									Authority
								</th>
								<th>
									Prority
								</th>
								<th>
									Operate
								</th>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="Authorities">
								<tr>
									<td align="center">
										<a
											href='<s:url action="edit" ><s:param name="authorityId" value="id"/></s:url>'>
											<s:property value="authority" /> </a>
									</td>
									<td align="center">
										<s:property value="priority" />
									</td>
									<td align="center">
									<a
											href='<s:url action="edit" ><s:param name="authorityId" value="id"/></s:url>'>
											Edit </a>&nbsp;&nbsp;
										<a href='<s:url action="delete" ><s:param name="authorityId" value="id" /></s:url>'>
											Delete </a> 
									</td>
								</tr>
							</s:iterator>
							<tr align="right">
								<td colspan="9">
									<a href='javascript:add();'> Add Authority </a> all
									<s:property value="totalRow" />
									rows&nbsp; the
									<s:property value="currentPage" />
									th page&nbsp; all
									<s:property value="pager.getTotalPages()" />
									pages&nbsp;
									<a
										href="<s:url value="list.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'first'"/>
    			
    		</s:url>">First</a>
									<a
										href="<s:url value="list.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'previous'"/>
    		</s:url>">Previous</a>
									<a
										href="<s:url value="list.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'next'"/>
    		</s:url>">Next</a>
									<a
										href="<s:url value="list.action">
    			<s:param name="currentPage" value="currentPage"/>
    			<s:param name="pagerMethod" value="'last'"/>
    		</s:url>">Last</a>
								</td>
							</tr>

						
						</tbody>
					</table>
  

</td><td width="16" background="images/mail_rightbg.gif"><img src="images/mail_rightbg.gif" width="16" height="17" /></td></tr>
</table>

			</td>
		</tr>
		<tr>
			<td>
			 <table width="100%" border="0" cellpadding="0" cellspacing="0">
			 	<tr>
			 		<td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
				    <td valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
				    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
			 	</tr>
			 </table>
			</td>    
		</tr>
	</table>


  </body>
</html>
